# INSTEAD Snippets
# Vim edition
# ver.0.1

# Starting template
snippet insteadbegin
	--$Name: ${1:Game name}$
	--$Author: ${2:Author name}$
	--$Version: ${3:0.1}$

	instead_version "1.4.1";

	game.codepage = ${4:"UTF-8"};
	game.act = ${5:"Не получается."};
	game.inv = ${6:"Гм... Странная штука."};
	game.use = ${7:"Не сработает..."};

	main = room {
		${8:-- Room}
	};
# One-letter snippets for rooms, objects, dialogs...
snippet r
	= room {
		${1:-- Room}
	};
snippet o
	= obj {
		${1:-- Object}
	};
snippet d
	= dlg {
		${1:-- Dialog}
	};
# Two-letter snippet for xroom
snippet xr
	= xroom {
		${1:-- Xroom}
	};
# Three-letter for player ;)
snippet plr
	= player {
		${1:-- Player}
	},
# Stat and menu
snippet stat
	= stat {
		${1:-- Stat}
	};
snippet menu
	= menu {
		${1:-- Menu}
	};
# Requires, dofiles, gamefiles
snippet req
	require "${1:Module}";${2}
snippet dofile
	dofile "${1:Filename}";${2}
snippet gamefile
	gamefile("${1:Filename}");${2}
snippet doencfile
	doencfile("${1:Encoded file}");${2}
# Init()
snippet init
	function init()
		${1:-- Code}
	end;
# Snippets for texts in attributes
snippet nam
	nam = [[${1:Name}]],${2}
snippet dsc
	dsc = [[${1:Description}]],${2}
snippet act
	act = [[${1:Action text}]],${2}
snippet use
	use = [[${1:Use text}]],${2}
snippet used
	used = [[${1:Used text}]],${2}
snippet enter
	enter = [[${1:Enter text}]],${2}
snippet entered
	entered = [[${1:Entered text}]],${2}
snippet exit
	exit = [[${1:Exit text}]],${2}
snippet left
	left = [[${1:Left text}]],${2}
snippet inv
	inv = [[${1:Inventory text}]],${2}
snippet tak
	tak = [[${1:Take text}]],${2}
snippet disp
	disp = [[${1:Display text}]],${2}
snippet pic
	pic = [[${1:gfx/pic.png}]],${2}
snippet xdsc
	xdsc = [[${1:Description}]],${2}
snippet life
	life = [[${1:Life text}]],${2}
snippet where
	where = [[${1:Where room}]],${2}
# Table-attributes
snippet obj
	obj = {
		${1:-- Objects}
	},
snippet way
	way = {
		${1:-- Ways}
	},
snippet var
	var {
		${1:-- Variables}
	},
# Bool attributes
snippet hideinv
	hideinv = true;${1}
snippet forcedsc
	forcedsc = true;${1}
# Funcions for attributes
snippet func
	= function()
		${1:-- Code}
	end,
snippet funcs
	= function(s)
		${1:-- Code}
	end,
snippet funcsw
	= function(s, w)
		${1:-- Code}
	end,
# Basic function
snippet function
	function ${1:Function_name} (${2:Params}){
		${3:-- Code}	
	};
# Dialog-related
snippet phr
	[${1:Number}] = phr(${2:You phrase}, ${3:Other phrase}, [[${4:Code}]]),${5}
snippet _phr
	[${1:Number}] = _phr(${2:You phrase}, ${3:Other phrase}, [[${4:Code}]]),${5}
# Logic
snippet if
	if ${1:Expression} then
		${2:-- Code}
snippet ifend
	if ${1:Expression} then
		${2:-- Code}
	end;${3}
snippet ifel
	if ${1:Expression} then
		${2:-- Code}
	else
		${3:-- Code}
	end;${4}
snippet elif
	elseif ${1:Expression} then
		${2:-- Code}
snippet elifend
	elseif ${1:Expression} then
		${2:-- Code}
	end;${3}
snippet ret
	return ${1:True};
# Other unsorted stuff...
snippet xact
	xact(${1:Name},${2:Text or code}),${3}
snippet p
	p [[${1:Text}]];
snippet code
	code[[${1}]]${2}
snippet click
	click = function(s, x, y)
		${1:-- Code}
	end,
